package Int;


import java.util.Stack;

public class Client {
    public static void main(String[] args)
    {
        Expression isMale = getMaleExpression();
        Expression isMarriedWoman = getMarriedWomanExpression();
        System.out.println("John is male?"+isMale.interpret("Male John"));
        System.out.println("Julie is maried women?"+isMale.interpret("Married Julie"));
    }

    public static Expression getMaleExpression(){
        Expression robet = new TerminalExpression("Robet");
        Expression john = new TerminalExpression("John");
        return new OrExpression(robet,john);
    }

    public static Expression getMarriedWomanExpression(){
        Expression julie = new TerminalExpression("Julie");
        Expression married = new TerminalExpression("Married");
        return new OrExpression(julie,married);
    }
}
